<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page isELIgnored="false" %> 

<%String path = request.getContextPath();%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	
    <link href="<%=path %>/css/index.css" type="text/css" rel="stylesheet" />
    <link href="<%=path %>/css/base.css" type="text/css" rel="stylesheet" />
    
    <style type="text/css">
		
	</style>
	

    <script type="text/javascript">
        function buy1()
	    {
	           <c:if test="${sessionScope.userType !=1}">
	                alert("请先登录");
	                return false;
	           </c:if>
	           
	            if(document.buy.quantity.value=="")
                {
                    alert("请输入订购数量");
                    return false;
                }
                
                document.buy.submit();
	    }
	</script>
	
	
</head>
  
<body>
	<div class="banner">
        <jsp:include flush="true" page="/qiantai/top.jsp"></jsp:include>
	</div>


    <div class="main01" style="margin-top: 10px;">
    	<!-- <h2>
            <span style="font-size: 18px;font-weight:900 ">商品信息</span>
            <div class="right" style="font-size: 14px;">dd</div>
        </h2> -->
        <div class="goods">
             <form action="<%=path %>/addToCart.action" method="post" name="buy">
							<table width="100%" border="0" cellpadding="9" cellspacing="9">
							    <tr>
							       <td align="left"><img src="<%=path %>/<s:property value="#request.goods.goodsPic"/>" width="520" height="350" style="border:1px solid #ccc; padding:3px;"/></td>
							    </tr>
							    <tr>
							       <td align="left">商品名称：<s:property value="#request.goods.goodsName"/></td>
							    </tr>
							    <tr>
							       <td align="left">商品介绍：<s:property value="#request.goods.goodsMiaoshu" escape="false"/></td>
							    </tr>
							    <tr>
							       <td align="left" >商品价格：<s:property value="#request.goods.goodsTejia"/></td>
							    </tr>
							    <tr>
							       <td align="left">订购数量：<input type="text" name="quantity" value="1" size="8" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"/></td>
							    </tr>
							    <tr>
							       <td>
							          <input type="hidden" name="goodsId" value="<s:property value="#request.goods.goodsId"/>"/>
							          <input type="button" value="购买" onclick="buy1()" style="width: 130px;"/>
							       </td>
							    </tr>
							</table>		    
						</form> 
        </div>
    </div>
    
    
    <br/>
    <div class="bottom">
        <jsp:include flush="true" page="/qiantai/down.jsp"></jsp:include>
    </div>
</body>
</html>
